package com.xxxx.seckill.controller;


import com.baomidou.mybatisplus.extension.api.R;
import com.xxxx.seckill.pojo.User;
import com.xxxx.seckill.service.IOrderService;
import com.xxxx.seckill.vo.OrderDetailVo;
import com.xxxx.seckill.vo.RespBean;
import com.xxxx.seckill.vo.RespBeanEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author macaber
 * @since 2021-09-30
 */
@Controller
@RequestMapping("/order")
public class OrderController {
    @Autowired
    IOrderService iOrderService;
@ResponseBody
    @RequestMapping("/detail")
public RespBean detail(User user,Long orderId){
if (user==null){
    return RespBean.error (RespBeanEnum.SESSION_ERROR);
}
   OrderDetailVo detail =iOrderService.detail(orderId);
return RespBean.success (detail);
}
}
